-
Notifications
You must be signed in to change notification settings - Fork 20
feat: implement initialize and execute states within update run #346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
07c7ac6 to
6a68b64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements the Start/Stop API for update runs, introducing state-based control over update run execution. The changes enable users to create update runs in a NotStarted state, transition them to Started to begin execution, Stopped to pause, and Abandoned to terminate. Key changes include:
- Updated the updateRun controller to use
Statefrom the Spec to determine execution flow - Modified conditional checks to disregard generation for immutable fields (only State changes)
- Refactored
executeUpdatingStageinto smaller helper methods to reduce complexity - Added comprehensive integration and E2E tests for state transitions
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/controllers/updaterun/controller.go | Added state-based execution control with early checks for Abandoned/Stopped states; modified initialization logic to ignore generation changes |
| pkg/controllers/updaterun/execution.go | Refactored executeUpdatingStage into smaller helper methods; removed generation checks from condition evaluations |
| pkg/controllers/updaterun/validation.go | Updated condition checks to be generation-independent for succeeded/failed states |
| pkg/utils/condition/reason.go | Added new condition reasons: UpdateRunPausedReason and UpdateRunAbandonedReason |
| test/e2e/staged_updaterun_test.go | Updated all createStagedUpdateRunSucceed calls to include state parameter; added comprehensive E2E test for state transitions |
| test/e2e/cluster_staged_updaterun_test.go | Updated all createClusterStagedUpdateRunSucceed calls to include state parameter; added E2E test for cluster-scoped state transitions |
| test/e2e/actuals_test.go | Added helper functions for validating NotStarted, Stopped, and Abandoned states; refactored status building logic |
| pkg/controllers/updaterun/*_integration_test.go | Updated test helpers to use reason strings; added integration tests for NotStarted/Stopped/Abandoned states |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Signed-off-by: Britania Rodriguez Reyes <[email protected]>
7d2cf9e to
c88d0d0
Compare
Signed-off-by: Britania Rodriguez Reyes <[email protected]>
be4dba0 to
b44f61f
Compare
Description of your changes
I have:
Update the update run controller to use State from the Spec to determine whether to Initialize or Execute.
Update Initialized condition to use
Unknownstatus as it starting to initialize and have the update run status reflect that.Updated conditional checks to disregard generation checks as update run is immutable but the State field.
Added/update integrations tests and e2e tests.
Run
make reviewableto ensure this PR is ready for review.How has this code been tested
Special notes for your reviewer
This change covers when update run starts as state
Initializethen toExecuteor starts at stateExecute.The initialized condition should be successfully initialized once. Therefore, the generation should always be 1 for update runs
Initializedcondition.Generation will change each time update run state is updated and only when the state is updated. The rest of update run spec is immutable. Can correlate generation with state change.